<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="initial-scale=1, width=device-width, maximum-scale=1, user-scalable=no">
	<meta name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale=1" media="(device-height: 568px)">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-touch-fullscreen" content="yes">
	<meta name="full-screen" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="format-detection" content="telephone=no">
	<meta name="format-detection" content="address=no">
	
	<!-- import CSS -->
	<link rel="stylesheet" href="assets/css/style.css">      
	<script src="assets/js/jquery.js"></script>
	
	<script>
		$(function(){
			$('.screen_a').click(function(){
				$('#screen').show();
				$('#screen_bg').show();
				$('html,body').addClass('ovfHiden'); //使网页不可滚动
			})
			$('.cancel').click(function(){
				$('#screen').hide();
				$('#screen_bg').hide();
				$('html,body').removeClass('ovfHiden'); //使网页恢复可滚
			})
		})
	</script>

</head>

<body>	
	
<!--筛选弹窗-->
<div class="screen" id="screen">
	<div class="screen_main">
	    <div class="binding_tit">商户名称：</div>
	    <div class="binding_select"><input value="请输入"></div>
	    <div class="binding_tit">归属地推：</div>
	    <div class="binding_select">
	    	<select>
	    		<option>请选择</option>
	    		<option>归属地推1</option>
	    		<option>归属地推2</option>	    		
	    	</select>
	    </div>	    
	    <div class="binding_btn">	    	
	    	<button class="state_confirm">确认</button>
	    	<button class="cancel">取消</button>
	    </div>
    </div>
</div>
<div id="screen_bg"></div>
	
<!-- 顶部 -->
<div class="head">
	<div class="head_back"><a href="index.html"><img src="assets/images/arrow.png"></a></div>
    <div class="head_txt">商户管理</div>
</div>

<div class="flow_btn">
	<a href="store_add.html" class="flow_a" style="width:35%;"><img src="assets/images/add.png">添加商户</a>
	<a href="javascript:;" class="flow_a flow_btn3 fr screen_a">筛选</a>
</div>

<div class="store_main">
	<ul class="showMoreNChildren" pagesize="1"><!--默认显示个数-->
		<li>
			<div class="store_head">
				<div class="store_h_left">商户名称：厦门油茶门店</div>
				<a href="">修改</a>
			</div>
			<div class="store_con">
				<span class="store_sp_left">电话：0592-4567893</span>
				<span class="store_sp_right">所属地推：林得水</span>
			</div>
			<div class="flow_sp mt1">
				<span class="flow_sp2">5元/小时</span>
				<span class="flow_sp3">30%</span>
			</div>
			<div class="sotre_btn">
				<a href="store_manage.html" class="sotre_btn1">机柜管理</a>
				<a href="details.html" class="sotre_btn1">查看详情</a>
			</div>	
		</li>
		<li>
			<div class="store_head">
				<div class="store_h_left">商户名称：厦门油茶门店</div>
				<a href="">修改</a>
			</div>
			<div class="store_con">
				<span class="store_sp_left">电话：0592-4567893</span>
				<span class="store_sp_right">所属地推：林得水</span>
			</div>
			<div class="flow_sp mt1">
				<span class="flow_sp2">5元/小时</span>
				<span class="flow_sp3">30%</span>
			</div>
			<div class="sotre_btn">
				<a href="store_manage.html" class="sotre_btn1">机柜管理</a>
				<a href="details.html" class="sotre_btn1">查看详情</a>
			</div>	
		</li>
		<li>
			<div class="store_head">
				<div class="store_h_left">商户名称：厦门油茶门店</div>
				<a href="">修改</a>
			</div>
			<div class="store_con">
				<span class="store_sp_left">电话：0592-4567893</span>
				<span class="store_sp_right">所属地推：林得水</span>
			</div>
			<div class="flow_sp mt1">
				<span class="flow_sp2">5元/小时</span>
				<span class="flow_sp3">30%</span>
			</div>
			<div class="sotre_btn">
				<a href="store_manage.html" class="sotre_btn1">机柜管理</a>
				<a href="details.html" class="sotre_btn1">查看详情</a>
			</div>	
		</li>
		<li>
			<div class="store_head">
				<div class="store_h_left">商户名称：厦门油茶门店</div>
				<a href="">修改</a>
			</div>
			<div class="store_con">
				<span class="store_sp_left">电话：0592-4567893</span>
				<span class="store_sp_right">所属地推：林得水</span>
			</div>
			<div class="flow_sp mt1">
				<span class="flow_sp2">5元/小时</span>
				<span class="flow_sp3">30%</span>
			</div>
			<div class="sotre_btn">
				<a href="store_manage.html" class="sotre_btn1">机柜管理</a>
				<a href="details.html" class="sotre_btn1">查看详情</a>
			</div>	
		</li>
	</ul>
</div>
<div id='showMorehandle' ><span>已经到底了</span></div>
</body>
</html>


<script>
(function () {
    var showMoreNChildren = function ($children, n) {
        //显示某jquery元素下的前n个隐藏的子元素
        var $hiddenChildren = $children.filter(":hidden");
        var cnt = $hiddenChildren.length;
        for ( var i = 0; i < n && i < cnt ; i++) {
            $hiddenChildren.eq(i).show();
        }
        return cnt-n;//返回还剩余的隐藏子元素的数量
                }
 
                //对页中现有的class=showMorehandle的元素，在之后添加显示更多条，并绑定点击行为
    $(".showMoreNChildren").each(function () {
        var pagesize = $(this).attr("pagesize") || 10;
            var $children = $(this).children();
            if ($children.length > pagesize) {
                for (var i = pagesize; i < $children.length; i++) {
                    $children.eq(i).hide();
                }
  
                $("<div class='showMorehandle' ><span>显示更多</span></div>").insertAfter($(this)).click(function () {
                if (showMoreNChildren($children, pagesize) <= 0) {
                    //如果目标元素已经没有隐藏的子元素了，就隐藏“点击更多的按钮条”
                    $(this).hide();
                    $('#showMorehandle').show();
                };
            });
        }
    });
})();
</script>

